import service from '@/utils/request'

export const getOrgApiUrl = (name:string)=>{
	if(name=='page'){
		return '/sys/org/list';
	}else if(name=='delete'){
		return '/sys/org/del';
	}
	return "";
}

export const useOrgListApi = () => {
	return service.get('/sys/org/list')
}

export const useOrgApi = (id: Number) => {
	return service.get('/sys/org/get?ids=' + id)
}

export const useOrgSubmitApi = (dataForm: any) => {
	if (dataForm.id) {
		return service.post('/sys/org/edit', dataForm)
	} else {
		return service.post('/sys/org/add', dataForm)
	}
}
